<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class Inc_Main_data_model extends CI_Model {

	function __construct()
	{
		parent::__construct();
	}

	function start()
	{
		echo '<p>Test2_Main_data_model</p>';
	}

	public function get_producttype(){
		$this->db->select('id,title');
		$rs = $this->db->get('producttype');
		return $rs->result();
	}

	public function get_broadcast(){
		$this->db->select('a.id, a.title, b.title as typetitle');
		$this->db->from('article a');
		$this->db->join('articletype b', 'a.typeid=b.id', 'left');
		$this->db->where(array('a.typeid'=>11));
		$this->db->limit(5);

		$q = $this->db->get();
		return $q->result();
	}

}
